<template>
    <div class="charts" ref="charts"></div>
</template>
<script>
import * as echarts from 'echarts'
export default {
    name: '',
    mounted() {
        //初始化charts
        let lineCharts = echarts.init(this.$refs.charts)
        lineCharts.setOption({
            xAxis: { show: false,min:0,max:100  },//show隐藏
            yAxis: { show: false,type: 'category' },
            series: [
                {
                    type: 'bar',
                    data: [78],
                    //柱条宽度
                    barWidth:35,
                    //柱条颜色
                    color:"#81C784",
                    //是否展示背景
                    showBackground:true,
                    backgroundStyle:{
                        color:'#eee',
                    },
                    label:{
                        show:true,
                        position:'right'
                    }
                },

            ],
            //布局调试
            grid: {
                left: 0,
                top: 0,
                right: 0,
                bottom: 0
            },
        })
    },
}
</script>
<style scoped>
.charts {
    width: 100%;
    height: 100%;
}
</style>
